<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .active {
      width: 200px;
      height: 200px;
      background: deeppink;
    }
  </style>
</head>

<body>
  <div id="box">你好</div>
  <button>点击</button>
  <script src="./jquery-3.4.1.min.js"></script>
  <script>
    // addClass("class名称") 添加class 
    $("#box").addClass("active")
    // removeClass() 移除class 
    $("#box").removeClass("active");
    // toggleClass() 切换添加和移除class
    $("button").click(function () {
      $("#box").toggleClass("active");
    })

  </script>
</body>

</html>